package cn.lijiguo.concurrency.part1.ch02;

/**
 * TicketWindow
 *
 * @author lijiguo
 * @date 2019/12/6 15:35
 */
public class TicketWindow implements Runnable {

    private int index = 1;

    private static final int MAX = 100;

    @Override
    public void run() {
        while(index <= MAX) {
            try {
                // 模拟窗口叫号耗时
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName() + ":" + index++);
        }
    }
}
